package com.lijj.activiti.entity;

import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.Expression;
import org.activiti.engine.delegate.JavaDelegate;

import com.lijj.activiti.webservice.HelloDelegate;
import com.lijj.activiti.webservice.HelloService;

public class WebServiceDelegate implements JavaDelegate {

	private Expression i;
	private Expression j;


	public void setI(Expression i) {
		this.i = i;
	}

	public void setJ(Expression j) {
		this.j = j;
	}

	public void execute(DelegateExecution execution) throws Exception {
		HelloService helloService = new HelloService();
		HelloDelegate delegate = helloService.getHelloPort();
		//System.out.println(delegate.getName("哈哈"));
		System.out.println(delegate.add(
				Integer.parseInt(i.getValue(null).toString()),
				Integer.parseInt(j.getValue(null).toString())));
	}

}
